rm(list = ls(all.names = TRUE))

# This is a function call to clean the environment panel in R Studio.
cat("\014")
# This is a function call to clean the R Console.
library(readxl)

# Run this library to read excel or csv file. If you do not have it then install the package by using a function call install.packages("readxl")#. 
# If you're reading from a CSV or Excel file, you would use something like read.csv() or read_excel() to load your data to a data frame

All_Nocta_Reddit <- read.csv("C:/Users/91992/IdeaProjects/PythonTraining/Nocta_Reddit_Thread_Cleaned.csv", header = TRUE)
# Load libraries for dataframe manipulation like dplyr, stringr to deal with string datatype, and purrr

library(dplyr)
## 
## Attaching package: 'dplyr'
## The following objects are masked from 'package:stats':
## 
##     filter, lag
## The following objects are masked from 'package:base':
## 
##     intersect, setdiff, setequal, union
library(stringr)
library(purrr)
# Create a dataframe with necessary columns for text processing

Nocta_Threads <- All_Nocta_Reddit[, c('selftext', 'link_flair_text')]
View(Nocta_Threads)
# Load necessary libraries for cleaning, text mining, and sentiment analysis

library(NLP)
library(tm)
# library(RColorBrewer)
library(SnowballC)
library(syuzhet)
# Remove the unnecessary special characters from the text

Nocta_Threads$selftext <- str_remove_all(Nocta_Threads$selftext, "–")
Nocta_Threads$selftext <- str_remove_all(Nocta_Threads$selftext, "’")
Nocta_Threads$selftext <- str_remove_all(Nocta_Threads$selftext, "—")
Nocta_Threads$selftext <- str_remove_all(Nocta_Threads$selftext, "“")
Nocta_Threads$selftext <- str_remove_all(Nocta_Threads$selftext, "”")
Nocta_Threads$selftext <- str_remove_all(Nocta_Threads$selftext, "-")
Nocta_Threads$selftext <- str_remove_all(Nocta_Threads$selftext, "&amp")
# Remove the mention of URL links from the text

Nocta_Threads$selftext <- str_remove_all(Nocta_Threads$selftext, "https://[^\\s]+")
View(Nocta_Threads)
# tm functions for text cleaning like removing punctuation and conforming text to lower case

Nocta_Threads$selftext <-removePunctuation(Nocta_Threads$selftext)
Nocta_Threads$selftext <-tolower(Nocta_Threads$selftext)
Nocta_Threads$selftext <-stripWhitespace(Nocta_Threads$selftext)
Nocta_Threads$selftext <-wordStem(Nocta_Threads$selftext) #function from SnowballC

Final_Nocta_Thread <- Nocta_Threads$selftext
head(Final_Nocta_Thread)
## [1] "definitely hoping this is considered a winter drop so we get another one for spring is this considered a winter drop or spring drop"                                                                                                                                                                                                                                                                                                                                                                                                                              
## [2] "hi all im letting go of my green nocta tech fleece ended up not wearing it much as i thought i wouldaround 34 times its a size small for the jacket and pants there is two discoloration stains as circled in the pics idk how they happened since it was in my closet most of the time i bought them from featurecom an invoice is attached via the pics at the end price 290 includes shipping us only pm if youre interested i can do zelle paypal and venmo or cashapp zelle is preferred pics and order invoice proof selling my green tech fleece size smal"
## [3] "ordered on drop day thursday and received a order is on the way email but it hasnt been picked upno updates from dhl since is anyone else having this problem with the drop usually i get a dispatch notification the next day and can track it instantly ordered the full black shell tracksuit black hoodie and the black cap for reference cardinal drop uk"                                                                                                                                                                                                   
## [4] "lc on these pl"                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   
## [5] "anyone know where best to buy this tracksuit besides from stockx"                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 
## [6] "never even thought about doing a legit check for these but now im curious thanks in advance ive had this hoodie for quite some time now really thick and keeps me warm and toasty was given by a friend"
tail(Final_Nocta_Thread)
## [1] "racing gear"                                                                                                                                                                                                                
## [2] "lc on these pls 🐯🀯"                                                                                                                                                                                                        
## [3] "anyone know wheres best to buy this tracksuit besides from stockx"                                                                                                                                                          
## [4] "what yall think this means exactly are items gonna restock if they sell out or will they just consistently produce stock regardless or just restock every season doesnt seem viable especially if they plan on adding color"
## [5] "the glide "                                                                                                                                                                                                                 
## [6] "does anyone know if i can use a nike giftcard on the nocta sit"
# Sentiment analysis:
# sentiment score using get_sentiment() function & scoring method
# scoring mehods: syuzhet, bing, afinn, nrc 
# Each method may have different scale

syuzhet_score <- get_sentiment(Final_Nocta_Thread, method="syuzhet")
head(syuzhet_score)
## [1]  0.60 -0.10 -0.65  0.00  0.50  3.10
summary(syuzhet_score)
##    Min. 1st Qu.  Median    Mean 3rd Qu.    Max. 
## -2.5000  0.0000  0.0000  0.3623  0.8000  3.8500
bing_score <- get_sentiment(Final_Nocta_Thread, method="bing")
head(bing_score)
## [1]  0 -1  0  0  1  1
summary(bing_score)
##    Min. 1st Qu.  Median    Mean 3rd Qu.    Max. 
## -3.0000  0.0000  0.0000  0.2111  1.0000  7.0000
afinn_score <- get_sentiment(Final_Nocta_Thread, method="afinn")
head(afinn_score)
## [1]  1  2 -3  0  3  5
summary(afinn_score)
##    Min. 1st Qu.  Median    Mean 3rd Qu.    Max. 
## -9.0000  0.0000  0.0000  0.5714  2.0000 12.0000
nrc_score <- get_sentiment(Final_Nocta_Thread, method="nrc")
head(nrc_score)
## [1]  0 -1 -1  0  0  2
summary(nrc_score)
##     Min.  1st Qu.   Median     Mean  3rd Qu.     Max. 
## -6.00000  0.00000  0.00000  0.04551  1.00000  5.00000
comb_score <- cbind(syuzhet_score, bing_score, afinn_score, nrc_score)
dimnames(comb_score) <- list(1:nrow(comb_score), c("syuzhet", "bing", "afinn", "nrc"))

Nocta_Threads_Analysis <- as.data.frame(comb_score)
head(df,20)
##                                               
## 1 function (x, df1, df2, ncp, log = FALSE)    
## 2 {                                           
## 3     if (missing(ncp))                       
## 4         .Call(C_df, x, df1, df2, log)       
## 5     else .Call(C_dnf, x, df1, df2, ncp, log)
## 6 }
# simple analysis based on syuzhet_score

min(Nocta_Threads_Analysis$syuzhet)
## [1] -2.5
minScore <- which(Nocta_Threads_Analysis$syuzhet==min(Nocta_Threads_Analysis$syuzhet))
minScore
## [1] 386 415
Final_Nocta_Thread[minScore]
## [1] "likely a shot in the dark but because i want all the chips with no stockx cuts ill shoot i have a black puffer jacket size large for sale in st louis if anyone wants to link up black puffer large stl"
## [2] "i understand i cant unless their damage or order was mistaken i seriously regret buying this anyone got any ideas someone help find a way to return thes"
sorted_scores <- sort(unique(Nocta_Threads_Analysis$syuzhet))
second_min_score <- sorted_scores[2]
minScore2 <- which(Nocta_Threads_Analysis$syuzhet==second_min_score)
Final_Nocta_Thread[minScore2]
## [1] "tf they got going on at nocta man i ordered this shi and 5 min later my shi gets cancelled why and i tried to do it again with the promo code and they denied that what a ducking scam this website is and i tried to buy it again with no promo and they still canceled it guess they dont want money order cancel"
third_min_score <- sorted_scores[3]
minScore3 <- which(Nocta_Threads_Analysis$syuzhet==third_min_score)
Final_Nocta_Thread[minScore3]
## [1] "bro they did me dirty on my pairs scratches and stains i reordered another pair nocta glides qu"
#Lets look at some positive ones

max(Nocta_Threads_Analysis$syuzhet)
## [1] 3.85
maxScore <- which(Nocta_Threads_Analysis$syuzhet==max(Nocta_Threads_Analysis$syuzhet))
maxScore
## [1] 278
Final_Nocta_Thread[maxScore]
## [1] "material is great jacket looks clean i got a m for both the pants and the jacket and oddly enough the pants fit well the jacket is a tad too small a large would be perfect the m is just not as baggy as id want a track suit for context im 510 170 pounds in pretty good shape i have broad shoulders and jacket feels a bit tight around my shoulders and arms will need to exchange for a l but pants can stay a m weird but anyway great product now i gotta cop some purple sneakers to go with them it anyone is in nyc and has a l they want to trade for an m hmu purple track jacket came in and i have some thought"
# Order the rows by the syuzhet score in descending order and take the top 5
top_positive_comments <- Nocta_Threads_Analysis %>%
  arrange(desc(syuzhet)) %>%
  head(10)

# Now, get the corresponding text from Final_Nocta_Thread
top_positive_comments
# Order the rows by the Afinn score in descending order and take the top 5
top_positive_comments_afinn <- Nocta_Threads_Analysis %>%
  arrange(desc(afinn)) %>%
  head(10)

# Now, get the corresponding text from Final_Nocta_Thread
top_positive_comments_afinn
# Order the rows by the Bing score in descending order and take the top 5
top_positive_comments_bing <- Nocta_Threads_Analysis %>%
  arrange(desc(bing)) %>%
  head(10)

# Now, get the corresponding text from Final_Nocta_Thread
top_positive_comments_bing
# Order the rows by the nrc score in descending order and take the top 5
top_positive_comments_nrc <- Nocta_Threads_Analysis %>%
  arrange(desc(nrc)) %>%
  head(10)

# Now, get the corresponding text from Final_Nocta_Thread
top_positive_comments_nrc
sorted_scores_desc <- sort(unique(Nocta_Threads_Analysis$syuzhet), decreasing = TRUE)
second_max_score <- sorted_scores_desc[2]
maxScore2 <- which(Nocta_Threads_Analysis$syuzhet==second_max_score)
Final_Nocta_Thread[maxScore2]
## [1] "anyone interested in buying 2 nocta hoodies for a deal its the yellow one and the grey one yellow is large and basically brand new without tags the grey is an xl but the person i got it from definitely put it in the dryer so it fits just like the large selling because i dont fit in large shoot me an offer i can post on ebay would be good for someone who likes oversized medium or a true to size large selling 2 nocta hoodies for d"
maxScore3 <- sorted_scores_desc[3]
maxScore3 <- which(Nocta_Threads_Analysis$syuzhet==maxScore3)
Final_Nocta_Thread[maxScore3]
## [1] "even though we are preparing for drop 3 of nocta i know sometimes people dont have money at the time of the drop i did some research and was able to find some remaining stock from drop 2 the links are direct and if they dont work please let me know and i will repost each available item individually nocta kith nocta a ma maniere nocta extra butter ny best trill drop 2 remaind"
# simple analysis based on bing score and find some of the most positive comments

max(Nocta_Threads_Analysis$bing)
## [1] 7
maxBScore <- which(Nocta_Threads_Analysis$bing==max(Nocta_Threads_Analysis$bing))
maxBScore
## [1] 74
Final_Nocta_Thread[maxBScore]
## [1] "i took some pictures of the 8000 m series jacket its a nice warm comfortable jacket i dont think its big enough to wear an another hoodie under it maybe a light sweater if you wanted to but the jacket is warm as it is in the 3rd picture the white fabric is a soft windbreaker like material the hood is detachable the last six pictures are me trying on the pants jacket and headband from the drop i will post pictures of the jump suit in a bit detailed look at nocta jacket"
sorted_bing_scores_desc <- sort(unique(Nocta_Threads_Analysis$bing), decreasing = TRUE)
second_max_bing_score <- sorted_bing_scores_desc[2]
maxBScore2 <- which(Nocta_Threads_Analysis$bing==second_max_bing_score)
Final_Nocta_Thread[maxBScore2]
## [1] "material is great jacket looks clean i got a m for both the pants and the jacket and oddly enough the pants fit well the jacket is a tad too small a large would be perfect the m is just not as baggy as id want a track suit for context im 510 170 pounds in pretty good shape i have broad shoulders and jacket feels a bit tight around my shoulders and arms will need to exchange for a l but pants can stay a m weird but anyway great product now i gotta cop some purple sneakers to go with them it anyone is in nyc and has a l they want to trade for an m hmu purple track jacket came in and i have some thought"
third_max_bing_score <- sorted_bing_scores_desc[3]
maxBScore3 <- which(Nocta_Threads_Analysis$bing==third_max_bing_score)
Final_Nocta_Thread[maxBScore3]
## [1] "ive been getting dms left and right asking for legit check on different nocta pants i have done comparisons of some reps vs authentic but for anyone who keeps asking for a legit check here you see all 3 retail pairs sizes xl and 2xl and how they should look pay attention to stitching color pockets tags otherwise its not always easy to tell by photo but in hand it becomes super obvious 🕠 nocta tech pants legit check"
# simple analysis based on bing score and find some of the most negative comments

min(Nocta_Threads_Analysis$bing)
## [1] -3
minBScore <- which(Nocta_Threads_Analysis$bing==min(Nocta_Threads_Analysis$bing))
minBScore
## [1]  59 149 151 406 415
Final_Nocta_Thread[minBScore]
## [1] "if you are waiting for something dont email and ask when its shipping because they will refund you without asking this company is a joke its stupid all i wanted to know was when it would be shipping and now in stuck with half a tracksuit�it cant be true�they got me a 30 what am i gonna do with that shit all the good stuff sold out already�this sucks dont email them they will refund y"
## [2] "bro they did me dirty on my pairs scratches and stains i reordered another pair nocta glides qu"                                                                                                                                                                                                                                                                                                   
## [3] "i wanna put this here for others so they dont get scammed the xxl tag is legit and the xl is completely fraudulent sadly 🗡 also the shade of blue is totally different real nocta tag vs fake on"                                                                                                                                                                                                  
## [4] "been looking for ages and still confused gotta break the bank but dont wanna miss out anyone know thanks heaps what time does it drop on the nocta website for melbourne australia tim"                                                                                                                                                                                                            
## [5] "i understand i cant unless their damage or order was mistaken i seriously regret buying this anyone got any ideas someone help find a way to return thes"
sorted_bing_scores <- sort(unique(Nocta_Threads_Analysis$bing))
second_min_score <- sorted_bing_scores[2]
minBScore2 <- which(Nocta_Threads_Analysis$bing==second_min_score)
minBScore2
##  [1]  46  89 129 176 178 262 310 311 373 431 477 523 586
Final_Nocta_Thread[minBScore2]
##  [1] "is this the wrong sole been put on a legit nocta or is it fake purchased from a reputable uk retailer thanks in advance legit or defect"                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          
##  [2] "i am male but i want blue fuzzy jumpsuit im thinking about getting large since i want loose fit but not too lose the nocta tech fleece in medium fit me perfectly but im thinking since this is womens size it might differ any thoughts on my decision also it is really no returs when buying directly from nocta website sizing on womens chalet polar topp"                                                                                                                                                                                                                                                                                                   
##  [3] "did anyone else nocta glide come in with horrible quality scratches everywhere scuff marks fresh out the box nocta glide triple white qc"                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         
##  [4] "tf they got going on at nocta man i ordered this shi and 5 min later my shi gets cancelled why and i tried to do it again with the promo code and they denied that what a ducking scam this website is and i tried to buy it again with no promo and they still canceled it guess they dont want money order cancel"                                                                                                                                                                                                                                                                                                                                              
##  [5] "did anyone else order a size 11 and receive a size 7 i checked and a bunch of people on twitter said they had the same issue nocta glide incorrect s"                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             
##  [6] "nocta send me size 7 when i ordered a size 10 i emailed them 3 weeks ago when i received the shoes and they have yet to respond to me have you guys had a negative experience with them wrong s"                                                                                                                                                                                                                                                                                                                                                                                                                                                                  
##  [7] "ive been having issues with 2 of my packages shipping my first package was en route to a dhl facility for over 20 days before the tracking number just stopped working and my second package is currently stuck at a ups facility and cant continue to move because nocta havent provided a invoice i contacted both dhl and ups and they both said i should keep trying to contact nocta about the packages ive attempted to contact nocta for 10 days now with 5 emails and havent received any type of acknowledgment or reply have other people been having these issues and is there any other way to contact them issues with shipping and contacting nocta"
##  [8] "hi i ordered a nocta hoodie from the restock 23sep still havent received it they arent replying to their emails im from the uk anyone else having this problem nocta order delayed by 6week"                                                                                                                                                                                                                                                                                                                                                                                                                                                                      
##  [9] "im tall and super skinny 63 155lbs does anyone know what size jacket i should cop usually wear a size l in hoodies but i dont want the jacket to be oversized cause my current winter jacket is a lil too big for me and its mad frustrating lol thx puffer jacket s"                                                                                                                                                                                                                                                                                                                                                                                             
## [10] "im 170 got a nocta open hem sweat in size small and holy fuck they are long as hell i estimated from the model she is 175 and the slack aint that much plus she wearing a size m for a 5cm diff why the hell is there so much slack anybody who is 170 or below facing this issue is this normal and how ur style this if its so long help appreciated open hem sweats not for short peopl"                                                                                                                                                                                                                                                                       
## [11] "can we just chill on the lc for this piece like seriously the last 15 posts have just been lc for this fucking tech odds are if its not from nocta nike ovo goat or even stockx then its fake save the post blue nocta tech fleec"                                                                                                                                                                                                                                                                                                                                                                                                                                
## [12] "placed my order at 1201 and somehow out of stock� fucking bullshit�"                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              
## [13] "what is this bullshit after maintenance all i can order from eu is a stupid cap"
# simple analysis based on afinn score and find some of the most positive comments

max(Nocta_Threads_Analysis$afinn)
## [1] 12
maxAScore <- which(Nocta_Threads_Analysis$afinn==max(Nocta_Threads_Analysis$afinn))
maxAScore
## [1] 248 278
Final_Nocta_Thread[maxAScore]
## [1] "can anyone help me out before i make an order for the new swarovski shorts i just want to know if they are true to size or not seems like nobody has tried them on yet 🞠 most of my nocta stuff runs way too big but the stuff from this collection has seemingly run small i am a tts medium but wear large in lots of stuff for comfort thanks nocta swarovski shorts s"                                                                                                                                                                                                                                                      
## [2] "material is great jacket looks clean i got a m for both the pants and the jacket and oddly enough the pants fit well the jacket is a tad too small a large would be perfect the m is just not as baggy as id want a track suit for context im 510 170 pounds in pretty good shape i have broad shoulders and jacket feels a bit tight around my shoulders and arms will need to exchange for a l but pants can stay a m weird but anyway great product now i gotta cop some purple sneakers to go with them it anyone is in nyc and has a l they want to trade for an m hmu purple track jacket came in and i have some thought"
# simple analysis based on afinn score and find some of the most negative comments

min(Nocta_Threads_Analysis$afinn)
## [1] -9
minAScore <- which(Nocta_Threads_Analysis$afinn==min(Nocta_Threads_Analysis$afinn))
minAScore
## [1] 151
Final_Nocta_Thread[minAScore]
## [1] "i wanna put this here for others so they dont get scammed the xxl tag is legit and the xl is completely fraudulent sadly 🗡 also the shade of blue is totally different real nocta tag vs fake on"
sorted_afinn_scores_desc <- sort(unique(Nocta_Threads_Analysis$afinn), decreasing = TRUE)
second_min_afinn_score <- sorted_afinn_scores_desc[2]
minAScore2 <- which(Nocta_Threads_Analysis$afinn==second_min_afinn_score)
minAScore2
## [1]  32 243
Final_Nocta_Thread[minAScore2]
## [1] "was looking to buy the set but curious on what size to get i am 57 160lbs would a medium be good or a large i usually like a looser fit any feedback would be appreciated thanks nocta polar chalet s"
## [2] "fanaticism aside are they worth copping at resell price 210220 are the materials a big improvement in terms of quality are they at the same level as supreme air forces nocta air forc"
third_min_afinn_score <- sorted_afinn_scores_desc[3]
minAScore3 <- which(Nocta_Threads_Analysis$afinn==third_min_afinn_score)
minAScore3
## [1] 11
Final_Nocta_Thread[minAScore3]
## [1] "anyone interested in buying 2 nocta hoodies for a deal its the yellow one and the grey one yellow is large and basically brand new without tags the grey is an xl but the person i got it from definitely put it in the dryer so it fits just like the large selling because i dont fit in large shoot me an offer i can post on ebay would be good for someone who likes oversized medium or a true to size large selling 2 nocta hoodies for d"
# simple analysis based on nrc score and find some of the most negative comments

min(Nocta_Threads_Analysis$nrc)
## [1] -6
minNScore <- which(Nocta_Threads_Analysis$nrc==min(Nocta_Threads_Analysis$nrc))
minNScore
## [1] 10
Final_Nocta_Thread[minNScore]
## [1] "interested to know what people think about this i am sitting on a ridiculous amount of nocta product accumulated over the past 2 months dont even know why i bought this shit tbh dont even wear it much do yall think nocta items will end up forgotten and worthless or do yall think they might gain value as time goes on interested to see what ppl think at this point too late anyways worn most of it so its whatever prolly spent like 4500 on random nocta shit since december definitely not gunna see that money again 🔥 what do yall think any value in the future as it becomes more rare or is the drake curse too strong speculation on worth� of nocta"
norm_score <- cbind(
                    sign(syuzhet_score), 
                    sign(bing_score), 
                    sign(afinn_score),
                    sign(nrc_score))

dimnames(norm_score)<-list(1:nrow(norm_score), c("Syuzhet", "Bing", "Afinn", "NRC"))
head(norm_score)
##   Syuzhet Bing Afinn NRC
## 1       1    0     1   0
## 2      -1   -1     1  -1
## 3      -1    0    -1  -1
## 4       0    0     0   0
## 5       1    1     1   0
## 6       1    1     1   1
finalscore<-as.data.frame(norm_score)
head(finalscore,20)
round(prop.table(table(finalscore$Syuzhet)),2)
## 
##   -1    0    1 
## 0.22 0.31 0.47
library(plotly)
## Loading required package: ggplot2
## 
## Attaching package: 'ggplot2'
## The following object is masked from 'package:NLP':
## 
##     annotate
## 
## Attaching package: 'plotly'
## The following object is masked from 'package:ggplot2':
## 
##     last_plot
## The following object is masked from 'package:stats':
## 
##     filter
## The following object is masked from 'package:graphics':
## 
##     layout
nrc_sentiment <- get_nrc_sentiment(Final_Nocta_Thread)

# Calculate the sum of sentiments

sentisum <- colSums(nrc_sentiment)

# Create an interactive bar plot using plotly

p <- plot_ly(x = names(sentisum), y = sentisum, type = 'bar', marker = list(color = scales::brewer_pal(palette = "Set2")(10))) %>%
  layout(title = "Emotions and Sentiments", xaxis = list(title = ""), yaxis = list(title = "Count"))
## Warning in RColorBrewer::brewer.pal(n, pal): n too large, allowed maximum for palette Set2 is 8
## Returning the palette you asked for with that many colors
# To view the plot, simply print `p`

p
nrc_sentiment$text <- Final_Nocta_Thread
# Filter for 'anger' emotion or sort by 'anger' to find the top entries
top_anger_texts <- nrc_sentiment %>%
  arrange(desc(anger)) %>%
  head(n = 5) # Adjust n for more or fewer entries

# View the texts
print(top_anger_texts$text)
## [1] "interested to know what people think about this i am sitting on a ridiculous amount of nocta product accumulated over the past 2 months dont even know why i bought this shit tbh dont even wear it much do yall think nocta items will end up forgotten and worthless or do yall think they might gain value as time goes on interested to see what ppl think at this point too late anyways worn most of it so its whatever prolly spent like 4500 on random nocta shit since december definitely not gunna see that money again 🔥 what do yall think any value in the future as it becomes more rare or is the drake curse too strong speculation on worth� of nocta"                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     
## [2] "on nov 4 i ordered three items sysmau fleece hoodie sysmau fleece pants and ss top totaling like 350 dollars shipping to ontario the next day nov 5 i got an email confirming my items had shipped with canada post initially when i checked to track my package it stated item delayed sender has created a shipping label stay tuned for updates i understood my items may take a few weeks to ship however ive checked consistently for 5 weeks and no updates have been given as to when my items will even arrive nothing has changed since november 5th when my items shipped with canada post it just keeps saying item delayed� but the label for shipping was created i was hoping these items would come in for a birthday which has now passed and now i am wondering if i will even get my items in time for christmas i paid 22 in shipping and over 300 in apparel and i feel that the wait is getting ridiculous at this point with absolutely no communication or updates from the company ive emailed them 3x and havent spoken to sn actual person its just an automated message from cs saying please be patient we have a lot of orders� but people in ontario are getting their af1s and other black friday orders which are weeks after mine i am at a loss at this point of what i can actually do� i have ordered from them directly before and never had an experience as bad as this what can i actually do about not getting my order and no communication from nocta anyone else having this issu"
## [3] "am i tripping or is this a returnable defect it bothers the hell out of me because i feel like theyre already creased out the box ive email nocta support to see if they can assist me and im hoping they can exchange if not refund me the shoes i aint even tryna keep em or finesse them id send them back real quick defect on the af1"                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   
## [4] "selling nocta hot step air terra black and yellow colourway size 10 comes with original shoe and box worn once perfect conditioning starting price is 220 cad willing to negotiate and must pay for shipping if anyone is interested hit me up with offers ✅ selling nocta hot step air terra blackyellow colourway size 10"                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 
## [5] "likely a shot in the dark but because i want all the chips with no stockx cuts ill shoot i have a black puffer jacket size large for sale in st louis if anyone wants to link up black puffer large stl"
# Example for 'anticipation'
top_disgust_texts <- nrc_sentiment %>%
  arrange(desc(disgust)) %>%
  head(n = 10)

print(top_disgust_texts$text)
##  [1] "interested to know what people think about this i am sitting on a ridiculous amount of nocta product accumulated over the past 2 months dont even know why i bought this shit tbh dont even wear it much do yall think nocta items will end up forgotten and worthless or do yall think they might gain value as time goes on interested to see what ppl think at this point too late anyways worn most of it so its whatever prolly spent like 4500 on random nocta shit since december definitely not gunna see that money again 🔥 what do yall think any value in the future as it becomes more rare or is the drake curse too strong speculation on worth� of nocta"                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     
##  [2] "hi all im letting go of my green nocta tech fleece ended up not wearing it much as i thought i wouldaround 34 times its a size small for the jacket and pants there is two discoloration stains as circled in the pics idk how they happened since it was in my closet most of the time i bought them from featurecom an invoice is attached via the pics at the end price 290 includes shipping us only pm if youre interested i can do zelle paypal and venmo or cashapp zelle is preferred pics and order invoice proof selling my green tech fleece size smal"                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            
##  [3] "wts nike nocta top boy alien gore tex jacket wts nocta top boy jacket"                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        
##  [4] "on nov 4 i ordered three items sysmau fleece hoodie sysmau fleece pants and ss top totaling like 350 dollars shipping to ontario the next day nov 5 i got an email confirming my items had shipped with canada post initially when i checked to track my package it stated item delayed sender has created a shipping label stay tuned for updates i understood my items may take a few weeks to ship however ive checked consistently for 5 weeks and no updates have been given as to when my items will even arrive nothing has changed since november 5th when my items shipped with canada post it just keeps saying item delayed� but the label for shipping was created i was hoping these items would come in for a birthday which has now passed and now i am wondering if i will even get my items in time for christmas i paid 22 in shipping and over 300 in apparel and i feel that the wait is getting ridiculous at this point with absolutely no communication or updates from the company ive emailed them 3x and havent spoken to sn actual person its just an automated message from cs saying please be patient we have a lot of orders� but people in ontario are getting their af1s and other black friday orders which are weeks after mine i am at a loss at this point of what i can actually do� i have ordered from them directly before and never had an experience as bad as this what can i actually do about not getting my order and no communication from nocta anyone else having this issu"
##  [5] "any questions dm on insta luccsclothing based in the nl no pandabuy shit receipt available selling a nike nocta tech fleece baby blue legit from footdistrict"                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                
##  [6] "new want to sell wts nocta nike top boy gore tex jacket"                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      
##  [7] "hey yall i happened to buy a few extra nocta items at the nike store in dubai mall on sale so i am pretty negotiable i got a size medium and 2 xxls fresh out the store i opened the packaging just for photos dm me if interested sorry bout the photos i took them in my car nocta tech fleece for sal"                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     
##  [8] "wtb orange alien gore tex jacket pls someone selling the orange alien gore tex jacket someone selling the orange alien gore tex jacket"                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       
##  [9] "ive just recently became pretty interested and intrigued w nocta but god damn it seems hard to get im just wondering what are some of the apps or maybe social accts that yall follow to know when stuffs happening where do yall stay up to date on nocta "                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  
## [10] "i am male but i want blue fuzzy jumpsuit im thinking about getting large since i want loose fit but not too lose the nocta tech fleece in medium fit me perfectly but im thinking since this is womens size it might differ any thoughts on my decision also it is really no returs when buying directly from nocta website sizing on womens chalet polar topp"
#Lets look at the proportion of comments basis the category 

library(dplyr)
# Count the number of self text entries for each link_flair_text

Final_Nocta_Thread_summary <- Nocta_Threads %>%
  group_by(link_flair_text) %>%
  summarise(count = n())
# install.packages("viridis")
library(viridis)
## Loading required package: viridisLite
# Sort the dataframe in ascending order by the count
Final_Nocta_Thread_summary <- Final_Nocta_Thread_summary %>%
  arrange(desc(count))

# Create an interactive bar plot with plotly

interactive_bar <- plot_ly(Final_Nocta_Thread_summary, x = ~link_flair_text, y = ~count, type = 'bar',
                           marker = list(color = viridis::viridis(14, option = "D"))) %>%
  layout(title = 'Proportion of Reddit Comments by Category',
         xaxis = list(title = 'Category', categoryorder = "total descending"),
         yaxis = list(title = 'Count'))
interactive_bar
# Filter for conversations in the 'good review' category
good_review_conversations <- All_Nocta_Reddit %>%
  arrange(link_flair_text == "good review")

# View the filtered conversations
View(good_review_conversations$selftext)